package team.knowers.qzh.qzhserver.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import team.knowers.qzh.qzhserver.common.convention.result.Result;
import team.knowers.qzh.qzhserver.common.convention.result.Results;
import team.knowers.qzh.qzhserver.dto.resp.CourseContentDetailsRespDTO;
import team.knowers.qzh.qzhserver.service.CourseContentService;

import java.util.List;

/**
 * 课程章节段落内容控制层
 */
@RestController
@RequiredArgsConstructor
public class CourseContentController {
    private final CourseContentService courseContentService;

    /**
     * 获取章节内容
     */
    @GetMapping("/api/qzh-server/admin/v1/course/content/details/{sectionId}")
    public Result<List<CourseContentDetailsRespDTO>> getCourseContentDetailsById(@PathVariable("sectionId") Long id)
    {
        return Results.success(courseContentService.getCourseContentDetailsById(id));
    }

}
